<?php use_helper('Javascript') ?>
<?php foreach($pager->getResults() as $pic): ?>
    <div class="media_box">
        <div class="media_pic"><?php echo image_tag('/uploads/media/thumb/'.$pic->getImg()) ?></div>
        <?php echo button_to_remote('elimina', array(
            'update' => 'media_list',
            'url' => 'media/delete?picid='.$pic->getId()
        )) ?>&nbsp;&nbsp;
        <?php echo button_to_function('+ italiano',
            "addToText('<img src=\'http://".$host."/sito/web/uploads/media/"
            .$pic->getImg()."\' alt=\'".$pic->getTitle('it')."\' border=0 />', 'it', '"
            .$sf_user->getAttribute('prefix')."', '".$sf_user->getAttribute('field')."')") ?>
        <?php echo button_to_function('+ inglese',
            "addToText('<img src=\'http://".$host."/sito/web/uploads/media/"
            .$pic->getImg()."\' alt=\'".$pic->getTitle('en')."\' border=0 />', 'en', '"
            .$sf_user->getAttribute('prefix')."', '".$sf_user->getAttribute('field')."')") ?>

    </div>

<?php endforeach; ?>
<div style="clear:both"></div>

<?php if ($pager->haveToPaginate()): ?>
<div id="media_pager">
  <?php echo link_to_remote('&laquo;', array(
        'update' => 'media_list',
        'url' => 'media/index?page='.$pager->getFirstPage()
      )) ?>
  <?php echo link_to_remote('&lt;', array(
        'update' => 'media_list',
        'url' => 'media/index?page='.$pager->getPreviousPage()
      )) ?>
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <?php echo ($page == $pager->getPage()) ? $page : link_to_remote($page, array(
        'update' => 'media_list',
        'url' => 'media/index?page='.$page)
    ) ?>
    <?php if ($page != $pager->getCurrentMaxLink()): ?> - <?php endif ?>
  <?php endforeach ?>
  <?php echo link_to_remote('&gt;', array(
        'update' => 'media_list',
        'url' => 'media/index?page='.$pager->getNextPage())
  ) ?>
  <?php echo link_to_remote('&raquo;', array(
        'update' => 'media_list',
        'url' => 'media/index?page='.$pager->getLastPage())) ?>
</div>
<?php endif ?>

<?php echo link_to_function('<strong>chiudi</strong>', "Effect.BlindUp('media_list')") ?>